package com.pureut.scheduling.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.scheduling.domain.BackWeight;
import com.pureut.scheduling.domain.SchedulingPlan;
import com.pureut.scheduling.domain.SchedulingPlan2;
import com.pureut.scheduling.domain.dto.SchedulingOrderDto;
import com.pureut.scheduling.domain.dto.SchedulingPlanDto;
import com.pureut.scheduling.domain.vo.SchedulingPlanVo;
import com.pureut.scheduling.domain.vo.UpdateSaleVo;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Description 排程计划接口
 * @Param
 * @Date 22-12-16
 * @Author hl
 **/
public interface ISchedulingPlanService extends IService<SchedulingPlan> {


    /**
     * 查询计划排程信息
     */
    List<SchedulingPlanDto> selectPlanList(SchedulingPlanVo schedulingPlanVo);

    /**
     * 确认计划排程信息
     */
    int insertSchedulingPlan(SchedulingPlanVo schedulingPlanVo) throws Exception;

    /**
     * 计划退回
     */
    int updatePlanBackEdit(SchedulingPlan schedulingPlan);

    /**
     * 计划终止
     */
    int updatePlanTheEndEdit(SchedulingPlan schedulingPlan);

    /**
     * 查询单个计划
     */
    SchedulingOrderDto selectSchedulingPlanById(long planId);

    /**
     * 计划新增接受
     */
    int insertSchedulingOrderPlan(List<SchedulingPlanVo> planList);

    /**
     * 修改计划单为已经完成
     * @param backWeight
     * @return
     */
    int updatePlanBack(BackWeight backWeight);

    /**
     * 通过计划单号获取对应销售订单号(fegin调用)
     * @param planCode
     * @return
     */
    String getPlanData(String planCode);

    /**
     *查询排程计划信息(状态为“待排产、生产中”的单据)
     * @return
     */
    List<SchedulingPlanDto> getListByStatus();

    /**
     * 分切完成关结且水刺关结完成修改排程单和计划单状态为已完成
     */
    int updatePlanFinishStatus(BackWeight backWeight);

    /**
     * 计划排程根据计划单查出对应信息
     * @param planCode
     * @return
     */
    SchedulingPlanDto getPlanInfo(String planCode);


    /**
     * 修改计划排程单状态
     * @param updateSaleVo
     * @return
     */
    boolean updatePlanStatusUnit(UpdateSaleVo updateSaleVo);

    /**
     * 修改排程委外重量（扣减）
     * @param backWeight
     * @return
     */
    int updatePlanBackDelete(BackWeight backWeight);
}
